<div class="ibox float-e-margins">
    <div class="ibox-content" style="display: block;">
        {!! Form::open(['route' => 'admin.shop.goods.savePointDeductionSetting', 'class' => 'form-horizontal', 'id'=> 'store-system-settings', 'role' => 'form', 'method' => 'post']) !!}
        <div class="form-group">
            <label class="col-sm-4 control-label">全店禁用积分抵扣</label>
            <div class="col-sm-8">
                <label class="control-label">
                    <input type="radio" value="1" name="shop_point_disable" {{$pointSettings?'checked':''}}>
                    是
                    &nbsp;&nbsp;
                    <input type="radio" value="0" name="shop_point_disable" {{$pointSettings?'':'checked'}}>
                    否
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-4 control-label">积分折扣比例(单位:分)<i class="fa fa-question-circle" data-toggle="tooltip" data-placement="top" data-original-title="举例：如果值设为10，表示1个积分抵扣10分钱 "></i>：</label>

            <div class="col-sm-8">
                <label class="control-label">
                    <input type="text" class="form-control valid-num" value="{{settings('shop_point_proportion')?settings('shop_point_proportion'):2}}" name="shop_point_proportion" placeholder="">
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-4 control-label">门店积分抵扣上限%</label>
            <div class="col-sm-8">
                <input type="text" name="shop_point_order_limit" class="form-control valid-num"
                       value="{{settings('shop_point_order_limit')?settings('shop_point_order_limit'):0}}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-4 control-label">门店购物是否可获得积分</label>
            <div class="col-sm-8">
                <label class="control-label">
                    <input type="radio" value="1"
                           name="shop_get_point" {{settings('shop_get_point')?'checked':''}}>
                    是
                    &nbsp;&nbsp;
                    <input type="radio" value="0"
                           name="shop_get_point" {{settings('shop_get_point')?'':'checked'}}>
                    否
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-4 control-label">新人立减10元</label>
            <div class="col-sm-8">
                <label class="control-label">
                    <input type="radio" value="1"
                           name="shop_new_user_reduce" {{settings('shop_new_user_reduce_'.session('shop_id'))?'checked':''}}>
                    是
                    &nbsp;&nbsp;
                    <input type="radio" value="0"
                           name="shop_new_user_reduce" {{settings('shop_new_user_reduce_'.session('shop_id'))?'':'checked'}}>
                    否
                </label>
            </div>
        </div>

        <div class="ibox-content m-b-sm text-right">
            <input type="submit" class="btn btn-success" value="保存">
        </div>
        {!! Form::close() !!}
    </div>
</div>


<script>
    $(function () {
        // save return
        $('#store-system-settings').ajaxForm({
            success: function (result) {
                if (200 == result.code) {
                    swal({
                        title: "保存成功！",
                        text: "",
                        type: "success"
                    }, function () {
                        window.location = '{{route('admin.shop.goods.pointDeductionSetting')}}';
                    });
                } else {
                    swal("保存失败!", result.message, "error")
                }

            }
        });
    });
</script>